From e5ee887448ce3accf1befe1ed80c2153019f2555 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 15 Sep 2016 22:44:49 -0700 Subject: [PATCH] Avoid calling awful DatabaseBase::strictIPs() method That method should be removed since it encourages incompatibility Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e --- includes/changes/RecentChange.php | 3 ++- includes/db/DatabaseMssql.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 590fd3704f..ac5824bbc8 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -297,7 +297,8 @@ class RecentChange { } # If our database is strict about IP addresses, use NULL instead of an empty string - if ( $dbw->strictIPs() && $this->mAttribs['rc_ip'] == '' ) { + $strictIPs = in_array( $dbw->getType(), [ 'oracle', 'postgres' ] ); // legacy + if ( $strictIPs && $this->mAttribs['rc_ip'] == '' ) { unset( $this->mAttribs['rc_ip'] ); } diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 339174e7bb..f2e6a67a67 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -50,7 +50,7 @@ class DatabaseMssql extends DatabaseBase { return false; } - public function strictIPs() { + public function realTimestamps() { return false; } -- 2.20.1